import wx

        
class MFrame(wx.Frame):
    def __init__(self):
        wx.Frame.__init__(self, None, -1,  style=wx.FRAME_SHAPED)
##        shape = MShape()
        
        
        self.Bind(wx.EVT_LEFT_DOWN,     self.OnLeftDown)
        self.Bind(wx.EVT_LEFT_UP,       self.OnLeftUp)
        self.Bind(wx.EVT_MOTION,        self.OnMouseMove)
        self.setSize()
        
        
    def setSize(self):
        ds = wx.GetDisplaySize()
        self.SetSize(ds)
        x, y = ds
        sY = int(y*0.40)
        sX = int(x*0.15)
        w = int(x*0.7)
        h = 30
        self.SetShape(wx.Region(sX, sY, w, h))
        
    def OnLeftDown(self, evt):
        self.CaptureMouse()
        x, y = self.ClientToScreen(evt.GetPosition())
        originx, originy = self.GetPosition()
        dx = x - originx
        dy = y - originy
        self.delta = ((dx, dy))


    def OnLeftUp(self, evt):
        if self.HasCapture():
            self.ReleaseMouse()
    
    def OnMouseMove(self, evt):
        if evt.Dragging() and evt.LeftIsDown():
            x, y = self.ClientToScreen(evt.GetPosition())
            fp = (x - self.delta[0], y - self.delta[1])
            self.Move(fp)


def main():
    app = wx.App(False)
    frame = MFrame()
    frame.Show(True)
    app.MainLoop()

if __name__ == '__main__':
    main()